import type { FieldRule } from 'vant'

const mobileRule: FieldRule[] = [
  { required: true, message: '请填写手机号' },
  { pattern: /^1[3-9]\d{9}$/, message: '请填写合法手机号' }
]

const passwordRule: FieldRule[] = [
  { required: true, message: '请填写密码' },
  { pattern: /^\w{8,24}$/, message: '密码需8-24个字符' }
]

const codeRule: FieldRule[] = [
  { required: true, message: '请填写短信验证码' },
  { pattern: /^\d{6}$/, message: '验证码需6位数字' }
]

export { mobileRule, passwordRule, codeRule }
